3.25.64 \(\int \frac {(a+b x^n)^2}{x^3} \, dx\) [2464]

Optimal. Leaf size=50 \[ -\frac {a^2}{2 x^2}-\frac {b^2 x^{-2 (1-n)}}{2 (1-n)}-\frac {2 a b x^{-2+n}}{2-n} \]

[Out]

-1/2*a^2/x^2-1/2*b^2/(1-n)/(x^(2-2*n))-2*a*b*x^(-2+n)/(2-n)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {276} \begin {gather*} -\frac {a^2}{2 x^2}-\frac {2 a b x^{n-2}}{2-n}-\frac {b^2 x^{-2 (1-n)}}{2 (1-n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x^n)^2/x^3,x]

[Out]

-1/2*a^2/x^2 - b^2/(2*(1 - n)*x^(2*(1 - n))) - (2*a*b*x^(-2 + n))/(2 - n)

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b x^n\right )^2}{x^3} \, dx &=\int \left (\frac {a^2}{x^3}+2 a b x^{-3+n}+b^2 x^{-3+2 n}\right ) \, dx\\ &=-\frac {a^2}{2 x^2}-\frac {b^2 x^{-2 (1-n)}}{2 (1-n)}-\frac {2 a b x^{-2+n}}{2-n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 39, normalized size = 0.78 \begin {gather*} \frac {-a^2+\frac {4 a b x^n}{-2+n}+\frac {b^2 x^{2 n}}{-1+n}}{2 x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^n)^2/x^3,x]

[Out]

(-a^2 + (4*a*b*x^n)/(-2 + n) + (b^2*x^(2*n))/(-1 + n))/(2*x^2)

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 42, normalized size = 0.84

method result size
norman \(\frac {-\frac {a^{2}}{2}+\frac {b^{2} {\mathrm e}^{2 n \ln \left (x \right )}}{-2+2 n}+\frac {2 a b \,{\mathrm e}^{n \ln \left (x \right )}}{-2+n}}{x^{2}}\) \(42\)
risch \(-\frac {a^{2}}{2 x^{2}}+\frac {b^{2} x^{2 n}}{2 \left (-1+n \right ) x^{2}}+\frac {2 a b \,x^{n}}{\left (-2+n \right ) x^{2}}\) \(43\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*x^n)^2/x^3,x,method=_RETURNVERBOSE)

[Out]

(-1/2*a^2+1/2*b^2/(-1+n)*exp(n*ln(x))^2+2*a*b/(-2+n)*exp(n*ln(x)))/x^2

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2/x^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(n-3>0)', see `assume?` for mor
e details)Is

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 66, normalized size = 1.32 \begin {gather*} -\frac {a^{2} n^{2} - 3 \, a^{2} n + 2 \, a^{2} - {\left (b^{2} n - 2 \, b^{2}\right )} x^{2 \, n} - 4 \, {\left (a b n - a b\right )} x^{n}}{2 \, {\left (n^{2} - 3 \, n + 2\right )} x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2/x^3,x, algorithm="fricas")

[Out]

-1/2*(a^2*n^2 - 3*a^2*n + 2*a^2 - (b^2*n - 2*b^2)*x^(2*n) - 4*(a*b*n - a*b)*x^n)/((n^2 - 3*n + 2)*x^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 245 vs. \(2 (37) = 74\).
time = 0.25, size = 245, normalized size = 4.90 \begin {gather*} \begin {cases} - \frac {a^{2}}{2 x^{2}} - \frac {2 a b}{x} + b^{2} \log {\left (x \right )} & \text {for}\: n = 1 \\- \frac {a^{2}}{2 x^{2}} + 2 a b \log {\left (x \right )} + \frac {b^{2} x^{2}}{2} & \text {for}\: n = 2 \\- \frac {a^{2} n^{2}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} + \frac {3 a^{2} n}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} - \frac {2 a^{2}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} + \frac {4 a b n x^{n}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} - \frac {4 a b x^{n}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} + \frac {b^{2} n x^{2 n}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} - \frac {2 b^{2} x^{2 n}}{2 n^{2} x^{2} - 6 n x^{2} + 4 x^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x**n)**2/x**3,x)

[Out]

Piecewise((-a**2/(2*x**2) - 2*a*b/x + b**2*log(x), Eq(n, 1)), (-a**2/(2*x**2) + 2*a*b*log(x) + b**2*x**2/2, Eq
(n, 2)), (-a**2*n**2/(2*n**2*x**2 - 6*n*x**2 + 4*x**2) + 3*a**2*n/(2*n**2*x**2 - 6*n*x**2 + 4*x**2) - 2*a**2/(
2*n**2*x**2 - 6*n*x**2 + 4*x**2) + 4*a*b*n*x**n/(2*n**2*x**2 - 6*n*x**2 + 4*x**2) - 4*a*b*x**n/(2*n**2*x**2 -
6*n*x**2 + 4*x**2) + b**2*n*x**(2*n)/(2*n**2*x**2 - 6*n*x**2 + 4*x**2) - 2*b**2*x**(2*n)/(2*n**2*x**2 - 6*n*x*
*2 + 4*x**2), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2/x^3,x, algorithm="giac")

[Out]

integrate((b*x^n + a)^2/x^3, x)

________________________________________________________________________________________

Mupad [B]
time = 1.15, size = 43, normalized size = 0.86 \begin {gather*} \frac {b^2\,x^{2\,n}}{x^2\,\left (2\,n-2\right )}-\frac {a^2}{2\,x^2}+\frac {2\,a\,b\,x^n}{x^2\,\left (n-2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^n)^2/x^3,x)

[Out]

(b^2*x^(2*n))/(x^2*(2*n - 2)) - a^2/(2*x^2) + (2*a*b*x^n)/(x^2*(n - 2))

________________________________________________________________________________________